class BG3Weapon extends UTWeapon
	dependson(BG3PlayerController)
	config(Weapon)
	abstract;

//reload animation
var(Animations) name	WeaponReloadAnim;
var(Animations) name	ArmsReloadAnim;

//adding reload logic variables
var int AmmoPerClip;
var int NumberOfClips;
var int MaxNumberOfClips;

//how fast to reload
var float WeaponReloadTime;

//reloading state bool
var bool bIsReloading;

simulated function ReloadWeapon()
{
	PlayWeaponAnimation(WeaponReloadAnim,WeaponReloadTime,false);
	PlayArmAnimation(ArmsReloadAnim,WeaponReloadTime,false);
	NumberofClips-=1;
	AddAmmo(AmmoPerClip);
}

//overwritten for automatic reload
simulated function WeaponEmpty()
{
	//check if we still clips/bullets left
	if(NumberOfClips>0)
	{
		ReloadWeapon();
	}
	else
	{
	// If we were firing, stop
	if ( IsFiring() )
		{
			GotoState('Active');
		}

		if ( Instigator != none && Instigator.IsLocallyControlled() )
		{
			Instigator.InvManager.SwitchToBestWeapon( true );
		}
	}
}

defaultproperties
{
	//these things are absolutely needed for basic settings
	Begin Object class=AnimNodeSequence Name=MeshSequenceA
		End Object

	Begin Object class=UDKSkeletalMeshComponent Name=ArmsSkelMesh
		
		End Object

	Begin Object Name=FirstPersonMesh
		//SkeletalMesh=SkeletalMesh'Wp_k98.skemesh.sk_k98_3p'
		//AnimSets(0)=AnimSet'WP_LinkGun.Anims.K_WP_LinkGun_1P_Base'
		Animations=MeshSequenceA
		Scale=0.9
		FOV=55.0
	End Object

	Begin Object Name=PickupMesh
		//SkeletalMesh=SkeletalMesh'WP_ShockRifle.Mesh.SK_WP_ShockRifle_3P'
	End Object

	//ammo and fire characteristics
	ShotCost(0)=1
	ShotCost(1)=1
	AmmoCount=5
	LockerAmmoCount=20
	MaxAmmoCount=5
	AmmoPerClip=5
	NumberOfClips=5
	MaxNumberOfClips=5
	Spread(0)=0.0
	Spread(1)=0.0
	InstantHitDamage(0)=0.0
	InstantHitDamage(1)=0.0
	InstantHitMomentum(0)=0.0
	InstantHitMomentum(1)=0.0
	InstantHitDamageTypes(0)=class'DamageType'
	InstantHitDamageTypes(1)=class'DamageType'
	WeaponRange=22000
	ShouldFireOnRelease(0)=0
	ShouldFireOnRelease(1)=0
	WeaponFireTypes(0)=EWFT_InstantHit
	WeaponFireTypes(1)=EWFT_InstantHit
	WeaponProjectiles(0)=none
	WeaponProjectiles(1)=none
	FireInterval(0)=+1.0
	FireInterval(1)=+1.0

	//sounds
	WeaponFireSnd(0)=none
	WeaponFireSnd(1)=none
	ZoomInSound=SoundCue'A_Weapon_Sniper.Sniper.A_Weapon_Sniper_ZoomIn_Cue'
	ZoomOutSound=SoundCue'A_Weapon_Sniper.Sniper.A_Weapon_Sniper_ZoomOut_Cue'
	WeaponEquipSnd=SoundCue'A_Weapon_ShockRifle.Cue.A_Weapon_SR_RaiseCue'
	WeaponPutDownSnd=SoundCue'A_Weapon_ShockRifle.Cue.A_Weapon_SR_LowerCue'
	PickupSound=SoundCue'A_Pickups.Weapons.Cue.A_Pickup_Weapons_Shock_Cue'

	//animations
	WeaponFireAnim(0)=WeaponFire
	WeaponFireAnim(1)=WeaponFire
	ArmFireAnim(0)=WeaponFire
	ArmFireAnim(1)=WeaponFire
	WeaponPutDownAnim=WeaponPutDown
	ArmsPutDownAnim=WeaponPutDown
	WeaponEquipAnim=WeaponEquip
	ArmsEquipAnim=WeaponEquip
	WeaponIdleAnims(0)=WeaponIdle
	ArmIdleAnims(0)=WeaponIdle
	WeaponReloadAnim = WeaponReload
	ArmsReloadAnim = WeaponReload
	DefaultAnimSpeed=0.9
	EquipTime=+0.45
	PutDownTime=+0.33
	WeaponReloadTime=1.0
	ArmsAnimSet=none

	//muzzleflash
	EffectSockets(0)=MuzzleFlashSocket
	EffectSockets(1)=MuzzleFlashSocket
	MuzzleFlashDuration=0.33
	MuzzleFlashSocket=MuzzleFlashSocket
	MuzzleFlashPSCTemplate=WP_ShockRifle.Particles.P_ShockRifle_MF_Alt
	MuzzleFlashColor=(R=200,G=120,B=255,A=255)
	MuzzleFlashLightClass=class'UTGame.UTShockMuzzleFlashLight'

	//playerview stuff
	PlayerViewOffset=(X=0,Y=0,Z=0)
	FireOffset=(X=20,Y=5)

	//HUD and crosshair
	IconX=458
	IconY=83
	IconWidth=31
	IconHeight=45
	CrosshairImage=Texture2D'UI_HUD.HUD.UTCrossHairs'
	CrossHairCoordinates=(U=192,V=64,UL=64,VL=64)
	IconCoordinates=(U=600,V=341,UL=111,VL=58)
	CrosshairScaling=1.0
	WeaponCanvasXPct=0.35
	WeaponCanvasYPct=0.35
	SimpleCrossHairCoordinates=(U=276,V=84,UL=22,VL=25)

	//misc
	bSniping=true
	bUsesOffhand = true
	MaxDesireability=0.65
	AIRating=0.65
	CurrentRating=0.65
	bInstantHit=true
	bSplashJump=false
	bRecommendSplashDamage=false

	//attachment
	AttachmentClass=class'BG3Weapon_Attachment'
}